﻿CREATE TABLE [dbo].[ClassStudents]
(
	[SchoolYearID] INT NOT NULL, 
    [ClassID] INT NOT NULL, 
    [StudentID] NCHAR(20) NOT NULL  PRIMARY KEY, 
    [TeacherID] INT NOT NULL
	CONSTRAINT FK_ClassStudents_SchoolYears FOREIGN KEY ([SchoolYearID]) 
    REFERENCES SchoolYears ([SchoolYearID]) 
    ON DELETE CASCADE
    ON UPDATE CASCADE,
	CONSTRAINT FK_ClassStudents_Teachers FOREIGN KEY ([TeacherID]) 
    REFERENCES Teachers (TeacherID) 
    ON DELETE CASCADE
    ON UPDATE CASCADE,
	CONSTRAINT FK_ClassStudents_Classes FOREIGN KEY ([ClassID]) 
    REFERENCES Classes ([ClassID]) 
    ON DELETE CASCADE
    ON UPDATE CASCADE
)
